home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / ada / gwuada_9.zip / CONFIG.H < prev    next >
C/C++ Source or Header  |  1992-10-05  |  6KB  |  219 lines

  1. /*
  2.  * Copyright (C) 1985-1992  New York University
  3.  * 
  4.  * This file is part of the Ada/Ed-C system.  See the Ada/Ed README file for
  5.  * warranty (none) and distribution info and also the GNU General Public
  6.  * License for more details.
  7.  
  8.  */
  9. #ifndef _config_h
  10. #define _config_h
  11.  
  12. /* header file with common symbols to be used by all phases of Ada/Ed-C
  13.  *
  14.  * Note that some configuration information needs to be defined when porting
  15.  * to a new machine or operating system.
  16.  *
  17.  * Most importantly the following symbolic constants need to be set for
  18.  * each host
  19.  *
  20.  * WORDSIZE32 or WORDSIZE16 -- whether an "int" is 32 bits or 16 bits
  21.  * BSD or SYSTEM_V          -- for unix systems
  22.  * OP_SYS                   -- string representing info on machine/OS config
  23.  * ALIGN2 or ALIGN4         -- systems which need alignment as explained below
  24.  *
  25.  * ALIGN2 defined if data items other than char must be aligned on at least
  26.  * 2 byte boundaries. (e.g. MC68000).
  27.  * ALIGN4 defined if data items other than char must be aligned on at least
  28.  * 4 byte boundaries. (e.g. SPARC).
  29.  */
  30.  
  31. #ifdef sun
  32. #define WORDSIZE32
  33. #ifndef BSD
  34. #define BSD
  35. #endif
  36. #ifdef mc68000
  37. #define ALIGN2
  38. #define OP_SYS "Sun 3 - Sun OS"
  39. #endif
  40. #ifdef sparc
  41. #define ALIGN4
  42. #define OP_SYS "Sparc - Sun OS"
  43. #endif
  44. #endif
  45.  
  46. #if (defined _IBMR2) && (defined _AIX)
  47. #define SYSTEM_V
  48. #define WORDSIZE32
  49. #define ALIGN4
  50. #define OP_SYS "IBM RS/6000 AIX"
  51. #endif
  52.  
  53. #if (defined ultrix) && (defined mips)
  54. #define BSD
  55. #define WORDSIZE32
  56. #define ALIGN4
  57. #define OP_SYS "Decstation ULTRIX 4.x"
  58. #endif
  59.  
  60. #ifdef sgi
  61. #define WORDSIZE32
  62. #define SYSTEM_V
  63. #define ALIGN4
  64. #define OP_SYS "SGI Irix 4.x.x"
  65. #endif
  66.  
  67. #ifdef vax
  68. #define WORDSIZE32
  69. #define BSD
  70. #define OP_SYS "VAX BSD 4.3"
  71. #endif
  72.  
  73. #ifdef ALIGN4 
  74. #define ALIGN2
  75. #endif
  76.  
  77. #ifdef ALIGN2
  78. #define ALIGN_WORD
  79. #endif
  80.  
  81. #if (defined BSD) || (defined SYSTEM_V)
  82. #ifndef unix
  83. #define unix
  84. #endif
  85. #endif
  86.  
  87. /* 
  88.  * The following symbolic constants are defined for most implementations
  89.  * and only need to be changed if necessary.
  90.  * 
  91.  * NULLFILENAME -- a name representation a null file
  92.  *
  93.  * Return codes passed between phases:
  94.  *  RC_SUCCESS            everything ok 
  95.  *    RC_ERRORS            errors found, successful termination
  96.  *    RC_INTERNAL_ERROR    internal compiler error
  97.  *    RC_ABORT            e.g. file not found
  98.  *
  99.  * MACHINE_CODE -- defined to turn on capability for generated code trace
  100.  * in the compilation listing 
  101.  *
  102.  * LIBFILENAME -- the name of the library file. It should be "lib" unless
  103.  * the operating system at hand uses this for another meaning.
  104.  *
  105.  */
  106.  
  107. #define RC_SUCCESS         0
  108. #define RC_ERRORS          1
  109. #define RC_INTERNAL_ERROR  2
  110. #define RC_ABORT           3
  111. #define MACHINE_CODE
  112. #define LIBFILENAME "lib"
  113. #define OM NULL
  114.  
  115. #ifdef unix
  116. #define DIR_DELIMITER  "/"
  117. #define NULLFILENAME "/dev/null"
  118. #define SUPPORT_PRAGMA_INTERFACE
  119. #endif
  120.  
  121. #ifdef IBM_PC
  122. #define WORDSIZE32
  123. #define OP_SYS "(MS/DOS 3.0)"
  124. #define NULLFILENAME "NUL"
  125. #define DIR_DELIMITER  "\\"
  126. /* define DEBUG_INT to enable -i i instruction trace */
  127. /* enable on PC until certified except for EXPORT version */
  128. #ifndef EXPORT
  129. #define DEBUG_INT
  130. #endif
  131. #endif
  132.  
  133. #ifdef WORDSIZE32
  134. #define DIGS    4
  135. #define BAS    10000
  136. #define MAX_INTEGER 2147483647
  137. #define MIN_INTEGER -2147483648
  138. #define MIN_INTEGER_IMAGE "-2147483648"
  139. #define ADA_MANTISSA_SIZE    24
  140. /* BITS_SU gives the number of bits in a storage unit. */
  141. #define BITS_SU 32
  142. #endif
  143.  
  144. #ifdef WORDSIZE16
  145. #define DIGS    2
  146. #define BAS    100
  147. #define MAX_INTEGER    32767
  148. #define MIN_INTEGER    -32768
  149. #define MIN_INTEGER_IMAGE "-32768"
  150. /* Define MAX_INTEGER_LONG if C ints and longs have different sizes. */
  151. #define MAX_INTEGER_LONG 2147483647
  152. #define MAX_INTEGER_LONG_STRING "2147483647"
  153. #define ADA_MANTISSA_SIZE    24
  154. /* BITS_SU gives the number of bits in a storage unit. */
  155. #define BITS_SU 16
  156. #endif
  157.  
  158. #define TRUE 1
  159. #define FALSE 0
  160.  
  161. /* Error codes written by various phases to MSGFILE */
  162. /* Note: None of these should be defined to be 0 */
  163.  
  164. #define PRAGMA_LIST_ON 1
  165. #define PRAGMA_LIST_OFF 2
  166. #define PRAGMA_LIST_ERR 3
  167. #define PRAGMA_PAGE 4
  168.  
  169. #define ERR_LEXICAL 10
  170. #define ERR_SYNTAX 11
  171. #define ERR_SEMANTIC 12
  172. #define ERR_WARNING 13
  173. #define INFORMATION 14
  174. #define ERR_BIND    15
  175. #define ERR_COMPILER 16
  176.  
  177. /* Limits for interpreter */
  178.  
  179. #define MAX_PRIO        5  /* max priority value, prio = 0..5 */
  180. #define MAX_TASKS     128  /* max number of tasks */
  181. #define MAX_CUNITS     64  /* max number of compilation units */
  182. #define MAX_BODIES    256  /* max subprgs+task bodies+spec/body not in cunit */
  183. #define MAX_ALTS       64  /* maximum open alternatives */
  184. #define MAX_DISCR      64  /* maximum number of discriminants in record */
  185. #define MAX_IDLEN     256  /* maximum identifier length */
  186. #define MAX_LINE_LEN  256  /* maximum line length */
  187.  
  188. #ifdef IBM_PC
  189. #define MAX_MEM    32000  /* maximum words per heap */
  190. #else
  191. #define MAX_MEM    128000 /* maximum words in heap */
  192. #endif
  193.  
  194. /*  The following is a variable used for deciding whether to optimize
  195.  *  an array aggregate.  If specifies the maximum size of a segment
  196.  *  to be created on the data stack.  If an array aggregate is larger
  197.  *  than this, is will NOT be optimized.
  198.  *  It is also used in type.c in a way that should be reviewed (ds 7-18-86)
  199.  */
  200. #define MAX_STATIC_SIZE 10000
  201.  
  202. /* define SMALLOC to use smalloc for string allocation */
  203. #define SMALLOC
  204.  
  205. #ifndef EXPORT
  206. #define DEBUG
  207. #define CHAOS    
  208. #define TRACE
  209. #else
  210. #define chaos(v)             exit_internal_error()
  211. #define emalloct(n,s)            emalloc(n)
  212. #define malloct(n,s)            malloc(n)
  213. #define erealloct(ptr, size, msg)    erealloc(ptr, size)
  214. #define efreet(p,msg)            efree(p)
  215. #define ecalloct(n,m,msg)        ecalloc(n,m)
  216. #endif
  217.  
  218. #endif /* _config_h */
  219.